ff6af3c708206553d8c1a722a74b1e11086e7f85
[git-annex.git] /
1 [[!comment format=mdwn
2  username="nick.guenther@e418ed3c763dff37995c2ed5da4232a7c6cee0a9"
3  nickname="nick.guenther"
4  avatar="http://cdn.libravatar.org/avatar/9e85c6ca61c3f877fef4f91c2bf6e278"
5  subject="git-credential-netrc"
6  date="2022-09-08T02:02:39Z"
7  content="""
8 I've found a different workaround. `git` ships with an unmaintained(?) alternate netrc parser written in perl. You just need to install it:
9
10 ```
11 [kousu@nigiri ~]$ sudo cp -p /usr/share/git/credential/netrc/git-credential-netrc.perl /usr/lib/git-core/git-credential-netrc  # install
12 [sudo] password for kousu: 
13 [kousu@nigiri ~]$ chmod 600 ~/.netrc                                                   # it's rightly picky about permissions
14 [kousu@nigiri ~]$ git config --global credential.helper \"netrc -v\"
15 [kousu@nigiri tmp.HBEKK9D4TS]$ cd $(mktemp -d)
16 [kousu@nigiri tmp.oZpfrzbN2N]$ git clone http://localhost/.git annex-test              # this use ~/.netrc *directly*
17 Cloning into 'annex-test'...
18 [kousu@nigiri tmp.oZpfrzbN2N]$ cd annex-test/
19 [kousu@nigiri annex-test]$ git annex get                                               # this uses ~/.netrc indirectly via git-credential
20 get large.bin (from origin...) 
21 using gpg for GPG operations
22 Unable to read /home/kousu/.authinfo.gpg; skipping it
23 Unable to read /home/kousu/.netrc.gpg; skipping it
24 Unable to read /home/kousu/.authinfo; skipping it
25 Opening /home/kousu/.netrc...
26 ok
27 (recording state in git...)
28 ```
29
30
31 This seems to sidestep the problem! It's weird that `git clone` will read netrc directly, but `git credential fill` won't? Oh well.
32
33 There's a [SO post](https://stackoverflow.com/a/31609584/2898673) about this script.
34
35
36 I still think it would be good for the docs and the code to be made consistent: if `web-options` is supposed to invoke curl then make it invoke curl, or else not the corner cases where it won't invoke curl.
37
38 Hope this helps someone out down the road.
39 """]]